home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Free Software Collection 8 / FM Towns Free Software Collection 8.iso / t_os / pao / pvs_pvd / src / tiffhead.h < prev    next >
Text File  |  1994-06-01  |  3KB  |  97 lines

  1. /* << HighC V1.7 >> [FM-TOWNS] **********************************************
  2. *
  3. *    .PVS → TIFF 保存
  4. *    ----------------------------------------------------------------------
  5. *    Programmed by Y.Hirata ( NIFTY-ID: NAB03321  パオパオ )
  6. *
  7. *    NOTE: TAB=4
  8. ****************************************************************************/
  9.  
  10. #ifndef _TIFFHEAD_DEFINED
  11.     #define    _TIFFHEAD_DEFINED
  12.  
  13.     #include <stdio.h>
  14.  
  15.     typedef unsigned char        UCHAR ;
  16.     typedef unsigned short int    USHORT ;
  17.     typedef unsigned int        UINT ;
  18.     typedef unsigned long        ULONG ;
  19.  
  20.     typedef struct _TIFF_HEAD {
  21.         USHORT    fmt ;                            /*  フォーマット('II')        */
  22.         USHORT    ver ;                            /*  バージョン(42)            */
  23.         ULONG    off ;                            /*  IFDオフセット(8)            */
  24.     } TIFF_HEAD ;
  25.  
  26.     typedef struct _TIFF_IFD {
  27.         USHORT    tag ;                            /*  タグ種別                */
  28.         USHORT    type ;                            /*  フィールドタイプ            */
  29.         ULONG    len ;                            /*  フィールド長            */
  30.         ULONG    val ;                            /*  値またはオフセット        */
  31.     } TIFF_IFD ;
  32.  
  33.     typedef struct _TIFF_16 {
  34.         TIFF_HEAD    head ;            /*  +0            */
  35.         USHORT        ntag ;            /*  +8            */
  36.         TIFF_IFD    tag[16] ;        /*  +10(0Ah)    */
  37.         ULONG        tagend ;        /*  +202(CAh)    */
  38.         UCHAR        zero1[50] ;        /*  +206(CEh)    */
  39.         USHORT        red[16] ;        /*  +256(100h)    */
  40.         USHORT        green[16] ;        /*  +288(120h)    */
  41.         USHORT        blue[16] ;        /*  +320(140h)    */
  42.         UCHAR        zero2[144] ;    /*  +352(160h)    */
  43.         ULONG        xreso[2] ;        /*  +496(1F0h)    */
  44.         ULONG        yreso[2] ;        /*  +504(1F8h)    */
  45. //        UCHAR        data[0] ;        /*  +512(200h)    */
  46.     } TIFF_16 ;
  47.  
  48.     typedef struct _TIFF_32K {
  49.         TIFF_HEAD    head ;            /*  +0            */
  50.         USHORT        ntag ;            /*  +8            */
  51.         TIFF_IFD    tag[15] ;        /*  +10(0Ah)    */
  52.         ULONG        tagend ;        /*  +190(BEh)    */
  53.         UCHAR        zero1[302] ;    /*  +194(C2h)    */
  54.         ULONG        xreso[2] ;        /*  +496(1F0h)    */
  55.         ULONG        yreso[2] ;        /*  +504(1F8h)    */
  56. //        UCHAR        data[0] ;        /*  +512(200h)    */
  57.     } TIFF_32K ;
  58.  
  59.     typedef struct _TIFF_256 {
  60.         TIFF_HEAD    head ;            /*  +0            */
  61.         USHORT        ntag ;            /*  +8            */
  62.         TIFF_IFD    tag[16] ;        /*  +10(0Ah)    */
  63.         ULONG        tagend ;        /*  +202(CAh)    */
  64.         UCHAR        zero1[290] ;    /*  +206(CEh)    */
  65.         ULONG        xreso[2] ;        /*  +496(1F0h)    */
  66.         ULONG        yreso[2] ;        /*  +504(1F8h)    */
  67.         USHORT        red[256] ;        /*  +512(200h)    */
  68.         USHORT        green[256] ;    /*  +1024(400h)    */
  69.         USHORT        blue[256] ;        /*  +1536(600h)    */
  70. //        UCHAR        data[0] ;        /*  +2048(800h)    */
  71.     } TIFF_256 ;
  72.  
  73.     void make16Header( int sx,int sy ) ;
  74.     void make256Header( int sx,int sy ) ;
  75.     void make32KHeader( int sx,int sy ) ;
  76.     void savesize( int sw ) ;
  77.     int padding( int size,FILE *fp ) ;
  78.     int resolution( ULONG r1,ULONG r2,ULONG r3,ULONG r4,FILE *fp ) ;
  79.     USHORT palcnv( UCHAR pal ) ;
  80.     int header16_save( FILE *fp ) ;
  81.     int header256_save( FILE *fp ) ;
  82.     int header32K_save( FILE *fp ) ;
  83.     int header_save( FILE *fp ) ;
  84.     int vramdata_save( FILE *fp ) ;
  85.     int dos_save( FILE *fp ) ;
  86.     int vram_save( FILE *fp ) ;
  87.     int tiff_create( void ) ;
  88.     void mode_report( FILE *fp ) ;
  89.     int tiff_save( void ) ;
  90.  
  91. #endif
  92.  
  93. /*    HISTORY
  94. -----------------------------------------------------------------------------
  95. *    1994.01.13 : CREATE
  96. ---------------------------------------------------------------------------*/
  97.